<?php include("conn.php") ?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<?php include("public/cssjs.php");?>
<title>编辑员工 - 员工列表 - 湖北北盛 v1.1</title>
<meta name="keywords" content="湖北北盛后台管理系统-武汉湖北北盛网络营销策划有限公司">
<meta name="description" content="武汉湖北北盛网络营销策划有限公司_专注网站建设、小程序开发、app定制、品牌营销方案策划">
</head>
<body>
<?php
$con=new Mysql();
$sql = "select * from d_worker where id ='".$_GET["id"]."'";
$rs =$con->getRow($sql);
if($rs)
{
    $rsid=$rs["id"];
    $w_id=$rs["w_id"];
    $w_name=$rs["w_name"];
    $w_nichen=$rs["w_nichen"];
    $w_mobile=$rs["w_mobile"];
    $w_pic=$rs["w_pic"]; $w_psw=$rs["w_psw"];
}
?>
<article class="page-container">
	<form class="form form-horizontal" id="form-work-add" name="form1">
        <input type="hidden" class="input-text" value="<?php echo $rsid;?>" id="uid" name="uid">
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>员工编号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="<?php echo $w_id;?>" readonly disabled placeholder="" id="w_id" name="w_id">
		</div>
	</div>
        <div class="row cl">

            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>登录密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="password" class="input-text"  id="w_psw" name="w_psw"  style="background: #e8e8e8;color:#ff0000" >
                <input type="hidden" class="input-text" value="<?php echo $w_psw;?>" id="ow_psw" name="ow_psw">
                <p>若无需更改密码,此项不填即可!</p>
            </div>
        </div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>员工姓名：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="<?php echo $w_name;?>" placeholder="真实姓名" id="w_name" name="w_name">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>员工职务：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="<?php echo $w_nichen;?>"  placeholder="职务" id="w_nichen" name="w_nichen">
		</div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" value="<?php echo $w_mobile;?>" placeholder="联系电话" id="w_mobile" maxlength="11" name="w_mobile">
		</div>
	</div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>照片：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <iframe
                        src="../pic/images_UP.php?bd=w_pic&form=form1" name="key" width="448"
                        height="30" marginheight="0" scrolling="No" frameborder="0" id="key">IE</iframe>
                <input type="text" class="input-text" value="<?php echo $w_pic;?>" placeholder="" id="w_pic" name="w_pic">
            </div>
        </div>
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;保存修改&nbsp;&nbsp;">
		</div>
	</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去--> 
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/h-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/h-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript">
$(function(){
	$("#form-work-add").validate({
		rules:{
			w_name:{
				required:true,
				minlength:2,
				maxlength:5
			}

		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){

			var w_name=$("#w_name").val();
			var w_nichen=$("#w_nichen").val();
			var w_mobile=$("#w_mobile").val();
			var w_pic=$("#w_pic").val();
            var id=$("#uid").val();
            var w_psw=$("#w_psw").val();
            var ow_psw=$("#ow_psw").val();
			 $.ajax({
				type:"POST",
				url:"json/worker.php" ,
				data:{'w_name':w_name,'w_nichen':w_nichen,'w_mobile':w_mobile,'w_pic':w_pic,'w_psw':w_psw,'ow_psw':ow_psw,'id':id,'Type':'update'},
				datatype: "json",    
				success:function(data){
					if(data==1){
						layer.msg('编辑成功!',{icon:1,time:1000});
						var index=parent.layer.getFrameIndex(window.name);
						
						window.parent.location.reload();
						parent.layer.close(index);
						}else{

					     layer.msg('系统错误error!',{icon:1,time:1000});
							}
					

				}
			});
			

		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>